//
//  NSVipPopPageView.m
//  Meboo
//
//  Created by kyo on 2024/5/21.
//

#import "NSVipPopPageView.h"

@interface NSVipPopPageView ()

@end

@implementation NSVipPopPageView

#pragma mark - Life Cycle
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
//        [self setupUI];
    }
    return self;
}

#pragma mark - Public Metohd
- (void)setIndex:(NSInteger)index {
    _index = index;
    for (UIImageView *view in self.subviews) {
        if (view.tag >=100) {
            [view removeFromSuperview];
        }
    }
    for (int i = 0; i < self.totalNum; i++) {
        UIImageView *pageView = [UIImageView new];
        pageView.tag = 100+i;
        if (i == self.index) {
            pageView.image = ImageWithName(@"wlm_vip_pop_page_select");
        } else {
            pageView.image = ImageWithName(@"wlm_vip_pop_page_unselect");
        }
        [self addSubview:pageView];
        [pageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(MBWidthScale(12)*i);
            make.top.mas_equalTo(MBHeightScale(0));
            make.width.height.mas_equalTo(MBWidthScale(6));
        }];
    }
}

#pragma mark - UI

#pragma mark - Setter && Getter

@end
